#!/bin/bash

projectPath=$(cd $(dirname $0)/.. && pwd)
projectName="${projectPath##*/}"
scriptPath=${projectPath}/script
buildPath=${projectPath}/build
installPath=${projectPath}/install
logsPath=${projectPath}/logs
configPath=${projectPath}/config
configTargetPath=${installPath}/conifg

mkdir -p ${logsPath}

if test -f "${logsPath}/cmake.log" ; then
    rm ${logsPath}/cmake.log
fi

if test -d ${projectPath} -a ! -d ${logsPath} ; then
    mkidr -p ${logsPath}
fi

cd ${buildPath}
cmake -D PROJECT_NAME=${projectName} .. | tee ${logsPath}/cmake.log
